Skip to content

Keep VS Code Source Control scoped to the repo that owns each worktree#77

Merged
NagyVikt merged 1 commit intomainfrom
agent/codex/thedailyscooby-gmail-com-dup-2-vscode-foreign-worktree-routing
Apr 13, 2026
Merged

Keep VS Code Source Control scoped to the repo that owns each worktree#77
NagyVikt merged 1 commit intomainfrom
agent/codex/thedailyscooby-gmail-com-dup-2-vscode-foreign-worktree-routing

Conversation

@NagyVikt
Copy link
Copy Markdown
Collaborator

Automated by scripts/agent-branch-finish.sh (PR flow).

Foreign agent worktrees parked under this repo's .omx path were making VS Code show branches under the wrong repository. The prune flow now detects mismatched git common-dir ownership and moves those worktrees into the owning repo's .omx/agent-worktrees directory before normal cleanup logic runs. Added regression coverage for rerouting behavior.

Constraint: Must preserve existing cleanup semantics for merged/unmerged local agent branches

Rejected: Deleting foreign worktrees automatically | could destroy active work in another repo

Confidence: high

Scope-risk: narrow

Directive: Keep foreign routing in prune/cleanup path so cross-repo worktree bleed is corrected without a separate command

Tested: node --check bin/multiagent-safety.js; bash -n scripts/agent-worktree-prune.sh templates/scripts/agent-worktree-prune.sh; npm test

Not-tested: Manual VS Code UI verification after cleanup across multiple concurrently open repos
@NagyVikt NagyVikt force-pushed the agent/codex/thedailyscooby-gmail-com-dup-2-vscode-foreign-worktree-routing branch from 81631ea to cdf828b Compare April 13, 2026 19:43
@NagyVikt NagyVikt merged commit 7f03946 into main Apr 13, 2026
7 checks passed
@NagyVikt NagyVikt deleted the agent/codex/thedailyscooby-gmail-com-dup-2-vscode-foreign-worktree-routing branch April 13, 2026 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant